{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from dpk_connector import crawl, shutdown\n",
    "\n",
    "def on_downloaded(url: str, body: bytes, headers: dict) -> None:\n",
    "        print(f\"url: {url}, headers: {headers}, body: {body[:64]}\")\n",
    "\n",
    "user_agent = \"Mozilla/5.0 (X11; Linux i686; rv:125.0) Gecko/20100101 Firefox/125.0\"\n",
    "\n",
    "crawl(\n",
    "        [\"https://thealliance.ai/\"],\n",
    "        on_downloaded,\n",
    "        user_agent=user_agent,\n",
    "        depth_limit=1,\n",
    "        subdomain_focus=True,\n",
    "    )  # blocking call\n",
    "\n",
    "shutdown()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "dpk-6-basic-022dev2-py311",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
